@isTest
public class  UpdateOppSalesTeam_Test
 {
 public static testMethod void testAddAccountTeam() 
 {
    Test.startTest();
    string curAccId;
    
    List<User> memberUserIds=[select id from user where IsActive=True limit 1];
    Account acct = new Account();
    acct.Name = 'Test Account Team';
    acct.RecordTypeId = RecordTypeHelper.GetRecordTypeId('Account', 'CMR Agency Client');
      Database.Saveresult sr1 = Database.insert(acct); 
      curAccId = sr1.getId();
    
    
    AccountTeamMember new_ateam = new AccountTeamMember();
    new_ateam.AccountId = curAccId;
    new_ateam.TeamMemberRole = 'GM';
    new_ateam.UserId = memberUserIds[0].Id;
      Database.Saveresult at_sr = Database.insert(new_ateam);
    Opportunity opp = new Opportunity();
    opp.Name = 'Test Opportunity Team';
    opp.StageName = 'FirstStage';
    opp.CloseDate = Date.today();
    opp.AccountId = curAccId;
      opp.OwnerId = memberUserIds[0].Id;
    opp.RecordTypeId = RecordTypeHelper.GetRecordTypeId('Opportunity', 'Advanced Ad Solutions');
      Database.Saveresult sr2 = Database.insert(opp);
     string curOppId = sr2.getId();
    OpportunityTeamMember otm = new OpportunityTeamMember();
    otm.OpportunityId = curOppId;
    otm.UserId = memberUserIds[0].Id;
    otm.TeamMemberRole = 'Seller';
    Database.Saveresult otm_sr = Database.insert(otm);
    UpdateOppSalesTeam.updatesalesteam(opp.Id);
    Test.stopTest();
    }
    }